<%@codepage=65001%>
<!--#include file="classData.asp"-->
<%
Response.Buffer = True 
Response.ExpiresAbsolute = Now() - 1 
Response.Expires = 0 
Response.CacheControl = "no-cache" 
Response.AddHeader "Pragma", "No-Cache"


	ManagerId = Request.QueryString("mid")
	SeasonNum = Request.QueryString("snum")
	AreaLevel = Request.QueryString("level")

	set HuaObj = new sysData
	HuaObj.sqlConnOpen()
	
	set HuaRds=server.CreateObject("ADODB.recordset")
	HuaObj.DbQuery HuaRds,"LeaguePlan",QueryStr,0," SeasonNum = "&SeasonNum&" AND Arealevel = "&AreaLevel&" AND IfDone = 0 AND ( HomeId = "&ManagerId&" OR AwayId = "&ManagerId&" )"
	tnuma = HuaRds.RecordCount
	HuaRds.Close
	
	set HuaRdsB=server.CreateObject("ADODB.recordset")
	HuaObj.DbQuery HuaRdsB,"LeaguePlan",QueryStr,0," SeasonNum = "&SeasonNum&" AND Arealevel = "&AreaLevel&" AND IfDone = 1 AND ( HomeId = "&ManagerId&" OR AwayId = "&ManagerId&" )"
	tnumb = HuaRdsB.RecordCount
	HuaRdsB.Close
	
	set HuaRdsC=server.CreateObject("ADODB.recordset")
	HuaObj.DbQuery HuaRdsC,"LeaguePlan",QueryStr,0," SeasonNum = "&SeasonNum&" AND Arealevel = "&AreaLevel&" AND IfDone = 1 AND ConfirmUserId = "&ManagerId&" AND ( HomeId = "&ManagerId&" OR AwayId = "&ManagerId&" )"
	tnumc = HuaRdsC.RecordCount
	HuaRdsC.Close
	
	set HuaRdsD=server.CreateObject("ADODB.recordset")
	HuaObj.DbQuery HuaRdsD,"AreaCup",QueryStr,0," SeasonNum = "&SeasonNum&" AND IfDone = 0 AND ManagerId = "&ManagerId
	tnume = HuaRdsD.RecordCount
	
	if tnume = 1 Then
	
		CupLevel = HuaRdsD("CupLevel")
		
		Select Case CupLevel
		
			Case 1
				cup1Str = "大冠杯小组赛"
			Case 2
				cup1Str = "大冠杯资格赛"
			Case 5
				cup1Str = "联盟杯32强"
			Case 6
				cup1Str = "联盟杯资格赛"
			Case 51
				cup1Str = "联盟杯16强"
			Case 52
				cup1Str = "联盟杯8强"
			Case 53
				cup1Str = "联盟杯半决赛"
			Case 55
				cup1Str = "联盟杯决赛"
			Case 11
				cup1Str = "大冠杯16强"
			Case 12
				cup1Str = "大冠杯8强"
			Case 13
				cup1Str = "大冠杯半决赛"
			Case 15
				cup1Str = "大冠杯决赛"

		End Select
		
	
	End if
	
	HuaRdsD.Close
	
	set HuaRdsE=server.CreateObject("ADODB.recordset")
	HuaObj.DbQuery HuaRdsE,"LCPlan",QueryStr,0," SeasonNum = "&SeasonNum&" AND IfDone = 0 AND (HomeId = "&ManagerId&" OR AwayId = "&ManagerId&")"
	tnumf = HuaRdsE.RecordCount
	
	if tnumf = 1 Then
	
		CupLevel = HuaRdsE("CupLevel")
		
		Select Case CupLevel
		
			Case 61
				cup2Str = "左右杯外围赛"
			Case 62
				cup2Str = "左右杯64强"
			Case 63
				cup2Str = "左右杯32强"
			Case 64
				cup2Str = "左右杯16强"
			Case 65
				cup2Str = "左右杯8强"
			Case 66
				cup2Str = "左右杯半决赛"
			Case 67
				cup2Str = "左右杯决赛"

		End Select
		
	
	End if
	
	HuaRdsE.Close

	response.ContentType="text/xml"	
	Response.Write("<?xml version=""1.0"" encoding=""utf-8""?>"&vbcrlf)
	Response.Write("<xml>"&vbcrlf)
	Response.Write("<Shi ShiId = ""1"">")
	
	Response.Write("<numa>"&tnuma&"</numa>")
	Response.Write("<numb>"&tnumb&"</numb>")
	Response.Write("<numc>"&tnumc&"</numc>")
	Response.Write("<numd>"&(tnumb - tnumc)&"</numd>")
	Response.Write("<nume>"&tnume&"</nume>")
	Response.Write("<cup1>"&cup1Str&"</cup1>")
	Response.Write("<numf>"&tnumf&"</numf>")
	Response.Write("<cup2>"&cup2Str&"</cup2>")
	
	Response.Write("</Shi>"&vbcrlf)
	
	Response.Write("</xml>"&vbcrlf)
	
	HuaObj.sqlConnClose()


%>
